#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int removeElement(int* nums, int numsSize, int val) {
    int arr[100];
    int i = 0;
    int j = 0;
    while (j<numsSize)
    {
        if (nums[j] != val)
        {
            arr[i] = nums[j];
            i++;
            j++;
        }
        else
        {
            j++;
        }

    }
    memcpy(nums, arr,i*sizeof(int));
    return i;
}


int main()
{
	int nums[] = { 0,1,2,2,3,0,4,2 };
	int numsSize = sizeof(nums) / sizeof(nums[0]);
    int val = 2;
    int k = removeElement(nums, numsSize, val);


    return 0;

}